import { COUNT_NUM } from '../actionTypes'

const initialState = {
	count: 0
}

export default function count (state = initialState, action) {
	let { payload = 1 } = action
	switch (action.type) {
		case COUNT_NUM:
			return { ...state, count: state.count + payload }
		default:
			return state
	}
}